;;; +go-mode.el --- Initialization and mode setting.

;;; Homepage:
;; https://github.com/dominikh/go-mode.el

;;; Commentary:
;; Mode for Go.

;;; Code:

(use-package go-mode
  :ensure
  :hook
  (go-mode . lsp-deferred)
  :init
  (when (executable-find "go")
    (let ((info (shell-command-to-exit-code-and-string "go" "env" "GOPATH")))
      (when (= (car info) 0)
	(push (expand-file-name "bin" (substring (nth 1 info) 0 -1)) exec-path)))))

(provide '+go-mode)

;;; +go-mode.el ends here
